<?php
	session_start();
	
	require_once('Captchscii.class.php');
	$captchscii = new Captchscii();
	
	if(isset($_POST) && !empty($_POST)) {
		$captchscii->compare($_POST['captcha']);
	}
?>

<html>
	
	<head>
		<title></title>
		
		<style type="text/css">
			pre {
				background-color: #000;
				color: #FFF;
				margin: 0;
				display: inline-block;
				font-size: 6px;
				font-weight: bold;
				font-family: Courier, "Courier New";
				padding: 5px;
			}
			
			.captcha {
				display: inline-block;
				border: 3px inset #CCC;
			}
			
			.captcha-1 {
				font-size: 6px;
			}
			
			form {
				width: 300px;
			}
			
		</style>
		
	</head>
	
	<body>
		<?php
			if(isset($_POST) && !empty($_POST)) {
				if($captchscii->hasErrors()) {
					echo $captchscii->getErrors();
				} else {
					echo '<p>Yay, the code you entered is valid :)</p>';
				}
			}
		?>
		<form method="post">
			<?php echo $captchscii->getRandom(); ?>
			
			<p><label for="captcha">Enter Captcha Code: <input type="text" id="captcha" name="captcha" /></label></p>
			<p><input type="submit" value="Submit" /></p>
		</form>
	</body>
	
</html>